package com.ly.heart.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ly.common.utils.DateUtils;
import org.springframework.stereotype.Service;
import com.ly.heart.mapper.MaterialProcureMapper;
import com.ly.heart.domain.MaterialProcureEntity;
import javax.annotation.Resource;
import com.ly.heart.service.IMaterialProcureService;

/**
 * 物料采购信息Service业务层处理
 * 
 * @author wutao
 * @date 2024-07-04
 */
@Service
public class MaterialProcureServiceImpl extends ServiceImpl<MaterialProcureMapper, MaterialProcureEntity> implements IMaterialProcureService {

    @Resource
    private MaterialProcureMapper materialProcureMapper;

    /**
     * 查询物料采购信息
     * 
     * @param id 物料采购信息ID
     * @return 物料采购信息
     */
    @Override
    public MaterialProcureEntity selectMaterialProcureById(String id)
    {
        return materialProcureMapper.selectMaterialProcureById(id);
    }

    /**
     * 查询物料采购信息列表
     * 
     * @param materialProcure 物料采购信息
     * @return 物料采购信息
     */
    @Override
    public List<MaterialProcureEntity> selectMaterialProcureList(MaterialProcureEntity materialProcure)
    {
        return materialProcureMapper.selectMaterialProcureList(materialProcure);
    }

    /**
     * 新增物料采购信息
     * 
     * @param materialProcure 物料采购信息
     * @return 结果
     */
    @Override
    public int insertMaterialProcure(MaterialProcureEntity materialProcure)
    {
        materialProcure.setCreateTime(DateUtils.getNowDate());
        return materialProcureMapper.insertMaterialProcure(materialProcure);
    }

    /**
     * 修改物料采购信息
     * 
     * @param materialProcure 物料采购信息
     * @return 结果
     */
    @Override
    public int updateMaterialProcure(MaterialProcureEntity materialProcure)
    {
        materialProcure.setUpdateTime(DateUtils.getNowDate());
        return materialProcureMapper.updateMaterialProcure(materialProcure);
    }

    /**
     * 批量删除物料采购信息
     * 
     * @param ids 需要删除的物料采购信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialProcureByIds(String[] ids)
    {
        return materialProcureMapper.deleteMaterialProcureByIds(ids);
    }

    /**
     * 删除物料采购信息信息
     * 
     * @param id 物料采购信息ID
     * @return 结果
     */
    @Override
    public int deleteMaterialProcureById(String id)
    {
        return materialProcureMapper.deleteMaterialProcureById(id);
    }
}
